package com.platform.util;

import java.util.Arrays;

/**
 * @program:
 * @Description:
 * @Author: liweihai
 * @Date: Created in 2019/1/12 16:22
 */
public enum CashStatusEnum {
    ORDER_NO(0, "所有提现单"),
    CASH_STATUS_APPLY(1, "申请中"),
    CASH_STATUS_PASS(2, "通过"),
    CASH_STATUS_REJECT(3, "拒绝"),
    CASH_STATUS_FINISH(4, "完成");


    private Integer key;
    private String value;

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    CashStatusEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String getDesc(Integer key) {

        CashStatusEnum result = Arrays.stream(CashStatusEnum.values()).filter(state -> state.getKey() == key).findFirst().orElse(CashStatusEnum.ORDER_NO);
        return result.getValue();

    }
}
